#!/usr/bin/env python3
import urllib.request
import json
import random

messages = [dict(sid=random.randint(0,2**62),category=0, liked=True, latitude=random.uniform(50.05,51.05),
                        longitude=random.uniform(12.9, 14.7), accuracy=random.uniform(10,100)) for i in range(50)]

data = json.dumps(messages).encode('utf8')
request = urllib.request.Request("http://ithil.ujep.cz/te/insert.php")
request.add_header("Content-Type","application/json")
f = urllib.request.urlopen(request, data)
print(f.read().decode('utf-8'))
